package com.topgay.dao;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.topgay.domain.ChattingMessage;

public interface ChattingDAO {
	
	/**
	 * ChattingMessage 테이블에 보낸 ChattingMessage객체 insert.
	 * @param message
	 * @return 
	 */
	public abstract int insertMessageToChatting(ChattingMessage message);
	
	/**
	 * TimeLine 테이블에 보낸 ChattingMessage객체 insert.
	 * @param message
	 * @return 
	 */
	public abstract int insertMessageToTimeLine(ChattingMessage message);
	
	/**
	 * 내id와 ChattingMessage 테이블의 to_id컬럼의 id를 비교해 ChattingMessage객체 List select.
	 * @param fromId
	 * @return
	 */
	public abstract List<ChattingMessage> selectChattingMessageById(String timeLineName, String fromId);
	
	public abstract List<ChattingMessage> selectTimeLineMessageById(String timeLineName);
	
	public abstract int createTimeLineSeq(String timeLineName);
	
	/**
	 * rowNum를 갖고  ChattingMessage객체  select.
	 * @param rowNum
	 * @return 
	 */
	public abstract ChattingMessage selectMessageByNum(int rowNum);
	
	/**
	 * ChattingMessage 테이블내의 모든 ChattingMessage객체 List select.
	 * @param
	 * @return 
	 */
	public abstract List<ChattingMessage> selectAllMessage();
	
	/**
	 * TimeLine 테이블내의 해당 name을 갖는 row select.
	 * @param timeLineName
	 * @return 
	 */
	public abstract int selectTimeLineByName(String timeLineName);
}
